package com.wy.future;

import java.util.concurrent.*;

public class FutureTaskTest {
    public static void main(String[] args) {
        Callable<Integer> callable = ()->1;
        ExecutorService executorService = Executors.newFixedThreadPool(8);
        Future<Integer> submit = executorService.submit(callable);
        try {
            Integer integer = submit.get();
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }
    }
}
